package com.example.mrzhou.srtfoodapplication;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

import java.util.List;

/**
 * Created by SRTfood on 2017/1/12.
 */

public class SubscriberAdapter extends ArrayAdapter<Subscriber>{

    private int resourceId;

    public SubscriberAdapter(Context context, int textViewResourceId, List<Subscriber> objects) {
        super(context, textViewResourceId, objects);
        resourceId = textViewResourceId;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent){
        Subscriber subscriber=getItem(position);
        View view;
        ViewHolder viewHolder = null;
        if (convertView == null) {
            view = LayoutInflater.from(getContext()).inflate(resourceId, null);
            view.setTag(viewHolder);
        } else {
            view=convertView;
            viewHolder=(ViewHolder)view.getTag();
        }
        return view;
    }
    
    //将对象储存于一个内部类中
    class ViewHolder{
    }
}
